//
//  MCTopView.m
//  MCmeituan
//
//  Created by Mc on 15/12/13.
//  Copyright © 2015年 Mc. All rights reserved.
//

#import "MCTopView.h"

@interface MCTopView ()
@property (weak, nonatomic) IBOutlet UIButton *icon;
@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UILabel *subLab;




@end

@implementation MCTopView

+ (instancetype)topView{

    return [[[NSBundle mainBundle] loadNibNamed:@"MCTopView" owner:nil options:nil]lastObject ];
}

#pragma mark --设置数据的对象方法
- (void)setTitle:(NSString *)title
{

    self.titleLab.text = title;
    
}

- (void)setSubTitle:(NSString *)subTitle
{

    self.subLab.text = subTitle;
    
}

- (void)setIcon:(NSString *)icon andHightIcon:(NSString *)hightIcon
{

    [self.icon setImage:[[UIImage imageNamed:icon] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    
    [self.icon setImage:[[UIImage imageNamed:hightIcon] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateHighlighted];
    
}
#pragma mark --按钮的监听
- (void)addTarget:(id)target action:(SEL)action
{
    [self.icon addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
}
@end
